<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return['basic']=$this->plugin_setting('basic');
$return['ischecklogin']=cfc('core')->checklogin('','',true);
$this->model('member')->upmember();
if($_RQ['op']=='main'){
	set_html('title',$return['basic']['title']?:'首页');
	$member=model('core/member')->detail($_SESSION['uid'],array('credit1','credit2','credit3','credit4','credit5','credit6','mobile','groupid','avatar','nickname'));
	$this->model('model')->checklogin();	
	$user=pdo_get('jy_aixiaoyi_member',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
	$member=array_merge($member,$user);
	$member['avatar']=tomedia($member['avatar']);
	$return['member']=$member;
	//显示等级
	$mm = pdo_get('jy_aixiaoyi_member',array('mid'=>$member['id'],'uniacid'=>$_SESSION['uniacid']));
	$return['chatmember']=$mm;
	$return['jbnum']=intval($member['credit3']);
	$return['user']=$user;
	$return['showrecharge']=$_RQ['showrecharge']?:'';
	$return['item']=array();
	if($this->plugin_exists('jy_commission')){
		$return['jy_commission']=true;	
	}
	$return['basic']['bi_rate']=$return['basic']['bi_rate']?:1;
	$return['bi_rate']=round($return['basic']['bi_rate'],2)*1;
	//已经填写绑定
	$return['bdcount'] = pdo_count('jy_aixiaoyi_member',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid'],'fromuser >'=>0));
	//获取当前时间：
	$showtypetime1=mktime(10,30,0,date('m'),date('d'),date('Y'));
	$showtypetime2=mktime(14,00,0,date('m'),date('d'),date('Y'));
	$showtypetime3=mktime(17,00,0,date('m'),date('d'),date('Y'));
	$showtypetime4=mktime(21,00,0,date('m'),date('d'),date('Y'));
	if(TIMESTAMP<$showtypetime1){
		$return['showtype']=1;
	}elseif(TIMESTAMP>$showtypetime1 && TIMESTAMP<$showtypetime2){
		$return['showtype']=2;
	}elseif(TIMESTAMP>$showtypetime2 && TIMESTAMP<$showtypetime3){
		$return['showtype']=3;
	}elseif(TIMESTAMP>$showtypetime3 && TIMESTAMP<$showtypetime4){
		$return['showtype']=4;
	}elseif(TIMESTAMP>$showtypetime4){
		$return['showtype']=5;
	}
	$return['showdaytypetitle']=$this->showdaytype[$return['showtype']];
	$return['sharedata']=array(
		'title'=>$return['basic']['share_title'],
		'desc'=>$return['basic']['share_desc'],
		'link'=>custom_url('jy_aixiaoyi/index//fromuser='.$_SESSION['uid'],true),
		'imgUrl'=>tomedia($return['basic']['share_image']),
	);
	exi($return);
}